//
//  MePushMgr.h
//  MeLive
//
//  Created by liulei on 2017/5/11.
//  Copyright © 2017年 liulei. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MeLiveInfoModel.h"

typedef NS_ENUM(NSInteger, TCLiveStatus)
{
    TCLiveStatus_Online              = 0,
    TCLiveStatus_Offline             = 1,
};

// server申请推流地址
typedef void (^RequestPusherUrlHandler)(int result, MeLiveInfoModel* liveInfo);


typedef void (^RequestLinkMicPusherUrlHandler)(int errCode, NSString* pusherUrl, NSInteger timestamp, NSString* playUrl);

typedef void (^PusherMgrCompleteHandler)(int errCode);

/**
 * 推流端逻辑层相关代码，主要是与业务Server进行协议通信
 */

@interface MePushMgr : NSObject

@property(nonatomic, copy) NSString* userId;

+ (instancetype)sharedInstance;

/**
 *  向业务Server提交推流端的信息并从业务Server获取推流地址
 *
 *  @param userId   用户id
 *  @param isMobileShow    是否是手机直播（0:非手机直播，1:手机直播）
 *  @param orientation 横竖屏直播（landscape：横屏，portrait：竖屏
 */
- (void)getPusherUrlWithUserid:(NSString *)userId isMobileShow:(NSString *)isMobileShow orientation:(NSString *)orientation handler:(RequestPusherUrlHandler)handler;

/**
 *  连麦观众向业务Server提交推流端的信息并从业务Server获取推流地址
 *
 *  @param userId   用户id
 */
- (void) getPushUrlForLinkMic:(NSString*)userId handler:(RequestLinkMicPusherUrlHandler)handler;

@end
